<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>函数</title>
</head>
<body>
    <script>
        function add(){
            alert("add..")
        }

        //add(); //调用函数

        function sub(a,b){ 
            return a - b;
        }

        let result  = sub(10,5);
        console.log(result);

        //细节
        function test01(a){ 
            console.log("a:"+a);
        }
        //test01();

        //定义一个函数
        let adds = function(){
            console.log("adds");
        }

        //adds();

        //箭头函数
        let results = (a,b)=>a*b;
        console.log(results(10,5));
    </script>
</body>
</html>